package com.mytwo.mysecond.controller;

import com.mytwo.mysecond.Service.ServiceImpl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @author bobo
 * @description: ${description}
 * @date 2018-05-03 12:13
 */
@Controller
@RequestMapping(value = "/user")
public class UserController {
    @Autowired
    private UserServiceImpl userService;
    @RequestMapping(value = "/userLogin", method = RequestMethod.POST)
    public String userLogin(HttpServletRequest request, HttpSession session) throws Exception {
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        System.out.println(username + "---" +password);
        return userService.userLogin(username,password);
    }
    @RequestMapping(value = "/getMessage", method = RequestMethod.GET)
    public String getMessage() throws Exception {
        return userService.getMessage();
    }
}
